public class ClaimExtensionVF
{
    private Claim__c[] claim = new Claim__c[1];
    private ID oppId = null;
    public List<Opportunity> opportunityList {get; set;}
    public Integer expectedCredit {get; set;}   
    public Integer ytdAttainment {get; set;}    
    public Integer commisionRate {get; set;}    
    public Integer commissionAmount {get; set;} 
    public String comments {get; set;}  
    public Boolean approveButFlag {get; set;}
    public Boolean adjustApproveButFlag {get; set;}
    public Boolean sendInquiryButFlag {get; set;}
    public Boolean calculateButFlag {get; set;}
    public Boolean fileClaimButFlag {get; set;}
    public Boolean lookupButFlag {get; set;}
        
    public ClaimExtensionVF(ApexPages.StandardController myController)
    {
        claim[0] = (Claim__c)myController.getRecord();
        oppId = [select Opportunity__c from Claim__c where id = : claim[0].id].Opportunity__c;
//        OppClaimImpl oci = new OppClaimImpl();
          //getOpportunityDetails();
        Claim__c[] c = [select OwnerId, Claim__c.CreatedBy.ID from Claim__c where id = :claim[0].id];
        if(c[0].CreatedBy.Id == UserInfo.getUserId())
        {
         //   approveButFlag = false;
           // adjustApproveButFlag = false;
            //sendInquiryButFlag = false;
        }
        else
        {
           // approveButFlag = adjustApproveButFlag = sendInquiryButFlag = true;
            //calculateButFlag = fileClaimButFlag = false;
        }
    }
    
    public List<Opportunity> getOpportunityDetails()
    {
        opportunityList = [select Name, Amount, AccountId, Opportunity.Account.Name, ExpectedRevenue, Type, Description, OwnerId, Opportunity.Owner.Name, CloseDate, LeadSource, Opportunity.Campaign.Name, MainCompetitors__c, OrderNumber__c, CurrentGenerators__c, TrackingNumber__c from Opportunity where id = :oppId];
        return opportunityList;
    }
    
    public PageReference calculate()
    {
        return null;
    }

    public PageReference lookupPlanDocument()
    {
        return null;
    }

    public PageReference fileClaim()
    {
        return null;
    }

    public PageReference approve()
    {
        return null;
    }
    
    public Claim__c getClaimData()
    {
        Claim__c[] claimData = [select id, Claim__c.Opportunity__r.Amount, Commission_Amount__c, Commission_Rate__c, Attainment__c, Credit__c, Comments__c from Claim__c where id = :claim[0].id];
        if(claimData.size() > 0)
            return claimData[0];
        return null;
    }
}